@import './global.less';
@import './modal-glass.less';

/* 搜索栏和功能按钮样式 */
.search-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: var(--spacing-xl);
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 500px;
  flex: 1;
  min-width: 300px;
}

.search-input {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  padding: 12px 20px 12px 50px;
  font-size: 1.1rem;
  color: #fff;
  backdrop-filter: blur(4px);
  transition: var(--transition-default);
  box-shadow: var(--box-shadow-sm);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);

  &:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: var(--box-shadow-lg);
  }

  &::placeholder {
    color: rgba(255, 255, 255, 0.6);
  }
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.1rem;
}

.btn-clear-search {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: var(--transition-default);

  &:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
  }
}

.action-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

/* 视图切换按钮组 */
.view-toggle-group {
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  padding: 4px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--box-shadow-sm);
}

.view-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--font-size-md);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;

  &:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);

    i {
      transform: scale(1.1);
    }
  }

  &.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
  }

  i {
    transition: transform 0.3s ease;
  }
}

/* Cute按钮 */
.cute-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  color: #fff;
  font-size: var(--font-size-lg);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  backdrop-filter: blur(10px);
  box-shadow: var(--box-shadow-md);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  animation: bounceIn 0.8s ease-out;

  &::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.6s ease;
    transform: translate(-50%, -50%);
  }

  &:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: var(--box-shadow-lg);
    &::before {
      width: 100%;
      height: 100%;
    }
    i {
      transform: scale(1.2);
    }
  }

  &:active {
    transform: translateY(-1px) scale(1.05);
    transition: all 0.1s ease;
  }

  i {
    position: relative;
    z-index: 2;
    transition: var(--transition-default);
  }

  &:nth-child(1) {
    animation-delay: 0.1s;
  }
  &:nth-child(2) {
    animation-delay: 0.2s;
  }
  &:nth-child(3) {
    animation-delay: 0.3s;
  }
}

.cute-btn-primary {
  background: var(--gradient-primary);
  border: 2px solid var(--cute-btn-border-color);
  &:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    border-color: var(--cute-btn-border-hover-color);
  }
}

.cute-btn-secondary {
  background: linear-gradient(135deg, var(--info-color), #138496);
  border: 2px solid var(--cute-btn-border-color);
  &:hover {
    background: linear-gradient(135deg, #138496, var(--info-color));
    border-color: var(--cute-btn-border-hover-color);
  }
}

.cute-btn-success {
  background: var(--gradient-success);
  border: 2px solid var(--cute-btn-border-color);
  &:hover {
    background: var(--gradient-success-hover);
    border-color: var(--cute-btn-border-hover-color);
  }
}

.cute-btn-info {
  background: linear-gradient(135deg, #17a2b8, #138496);
  border: 2px solid var(--cute-btn-border-color);
  &:hover {
    background: linear-gradient(135deg, #138496, #0c6b7a);
    border-color: var(--cute-btn-border-hover-color);
  }
  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(20px);
  }
  50% {
    opacity: 1;
    transform: scale(1.05) translateY(-5px);
  }
  70% {
    transform: scale(0.9) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 应用网格和列表 */
.apps-grid-container {
  padding-bottom: var(--spacing-xl);
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.apps-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 应用卡片基础样式 */
.app-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  backdrop-filter: blur(4px);
  transition: var(--transition-default);
  cursor: pointer;
  position: relative;
  box-shadow: var(--box-shadow-sm);
  animation: fadeIn 0.5s ease;

  &:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
    border-color: rgba(255, 255, 255, 0.3);
  }
}

.app-card-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  padding: 20px;
  height: 100%;
}

/* 应用图标 */
.app-icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 80px;
  height: 80px;
  margin: 0 auto 8px;
  position: relative;
}

.app-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--border-radius-md);
  object-fit: cover;
  box-shadow: var(--box-shadow-md);
}

.app-icon-placeholder {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #ff6b6b, #ffa500);
  border-radius: var(--border-radius-md);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: var(--font-size-xxl);
  box-shadow: var(--box-shadow-md);
}

/* 应用信息 */
.app-info {
  text-align: center;
  margin-bottom: 15px;
  cursor: pointer;
  position: relative;
  padding: 8px;
  border-radius: var(--border-radius-md);
  transition: var(--transition-default);

  &:hover {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    transform: translateY(-1px);
  }

  &:active {
    transform: translateY(0) scale(0.98);
    background: rgba(255, 255, 255, 0.2);
  }

  &:not([title]),
  &[title=''] {
    cursor: default;
    pointer-events: none;
  }

  &.copy-success {
    animation: copySuccess 0.4s ease;
  }
}

@keyframes copySuccess {
  0% {
    transform: translateY(-1px) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.02);
    background: rgba(40, 167, 69, 0.3);
  }
  100% {
    transform: translateY(-1px) scale(1);
  }
}

.app-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-command {
  display: inline-block;
  text-align: left;
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 10px;
  font-family: 'Courier New', monospace;
  background: rgba(0, 0, 0, 0.2);
  padding: 5px 10px;
  border-radius: var(--border-radius-sm);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: var(--transition-default);

  &:hover {
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
  }
}

/* 应用标签 */
.app-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 15px;
}

.app-tag {
  background: rgba(255, 255, 255, 0.4);
  color: #333;
  padding: 4px 8px;
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.tag-exclude-global-prep-cmd {
  background: rgba(255, 105, 180, 0.6);
  color: #fff;
}
.tag-menu {
  background: rgba(147, 112, 219, 0.6);
  color: #fff;
}
.tag-elevated {
  background: rgba(255, 165, 0, 0.6);
  color: #fff;
}
.tag-detach {
  background: rgba(32, 178, 170, 0.6);
  color: #fff;
}

/* 操作按钮 */
.app-actions {
  display: flex;
  justify-content: center;
  gap: 10px;

  .btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    color: #fff;
    font-size: var(--font-size-md);
    transition: var(--transition-default);
    backdrop-filter: blur(5px);
  }
}

.btn-edit {
  background: rgba(0, 123, 255, 0.3);
  border: 1px solid rgba(0, 123, 255, 0.5);
  &:hover {
    background: rgba(0, 123, 255, 0.5);
    transform: scale(1.1);
  }
}

.btn-delete {
  background: rgba(220, 53, 69, 0.3);
  border: 1px solid rgba(220, 53, 69, 0.5);
  &:hover {
    background: rgba(220, 53, 69, 0.5);
    transform: scale(1.1);
  }
}

/* 拖拽手柄 */
.drag-handle {
  position: absolute;
  top: 10px;
  right: 10px;
  color: rgba(255, 255, 255, 0.4);
  cursor: move;
  font-size: var(--font-size-lg);
  padding: 5px;
  border-radius: 5px;
  transition: var(--transition-default);
  z-index: 10;

  &:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
  }
}

/* 拖拽状态 */
.app-card-dragging {
  opacity: 0.8;
  transform: scale(0.98);
}
.app-card-ghost {
  opacity: 0.3;
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.05) !important;
}
.app-card-chosen {
  transform: scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3) !important;
  z-index: 1000;
}
.app-card-drag {
  transform: rotate(5deg) scale(1.05);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4) !important;
}

/* 搜索指示器 */
.search-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-size: var(--font-size-md);
  padding: 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 10;
}

/* 搜索模式提示 */
.search-mode-hint {
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 193, 7, 0.4);
  border-radius: var(--border-radius-md);
  padding: 10px 15px;
  margin-bottom: 20px;
  color: var(--warning-color);
  font-size: var(--font-size-sm);
  text-align: center;
  backdrop-filter: blur(5px);
}

/* 空状态 */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius-xl);
  backdrop-filter: blur(10px);
}

.empty-icon {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 20px;
}
.empty-title {
  font-size: var(--font-size-xl);
  color: #fff;
  margin-bottom: 10px;
}
.empty-subtitle {
  font-size: var(--font-size-md);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
}

/* 消息提示 */
.alert-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: var(--border-radius-md);
  backdrop-filter: blur(10px);
  box-shadow: var(--box-shadow-lg);
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 500;
  animation: slideInRight 0.3s ease;
}

.alert-success {
  background: rgba(40, 167, 69, 0.8);
  border: 1px solid rgba(40, 167, 69, 0.5);
}
.alert-error {
  background: rgba(220, 53, 69, 0.8);
  border: 1px solid rgba(220, 53, 69, 0.5);
}
.alert-warning {
  background: rgba(255, 193, 7, 0.8);
  border: 1px solid rgba(255, 193, 7, 0.5);
}
.alert-info {
  background: rgba(23, 162, 184, 0.8);
  border: 1px solid rgba(23, 162, 184, 0.5);
}

.btn-close-toast {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  margin-left: 10px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  &:hover {
    opacity: 1;
  }
}

.btn-outline-danger {
  background: var(--danger-color);
  border: 1px solid rgba(220, 53, 69, 0.5);
  color: #fff;
  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
  }
}

.glass-panel {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: var(--border-radius-md) !important;
  backdrop-filter: blur(10px) !important;
  color: #fff !important;
}

/* 表格样式 */
.table-glass {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  backdrop-filter: blur(10px);

  th {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  td {
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

.env-var-name {
  background: rgba(0, 0, 0, 0.3) !important;
  color: var(--warning-color) !important;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  font-family: 'Courier New', monospace !important;
}

.code-example {
  background: rgba(0, 0, 0, 0.3) !important;
  color: #fff !important;
  padding: 15px !important;
  border-radius: var(--border-radius-md) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  font-family: 'Courier New', monospace !important;
  font-size: var(--font-size-sm) !important;
}

/* 动画 */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }
  .search-container {
    flex-direction: column;
    gap: 15px;
  }
  .search-box {
    max-width: 100%;
    min-width: auto;
  }
  .action-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }
  .cute-btn {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
  .page-title {
    font-size: 2rem;
  }
  .alert-toast {
    right: 10px;
    left: 10px;
    top: 10px;
  }
  .app-list-item-inner {
    padding: 12px 16px;
    gap: 12px;
  }
  .app-icon-container-list,
  .app-icon-list,
  .app-icon-placeholder-list {
    width: 50px;
    height: 50px;
  }
  .app-icon-placeholder-list {
    font-size: 1.2rem;
  }
  .app-name-list {
    font-size: var(--font-size-md);
  }
  .app-tags-list {
    gap: 4px;
  }
  .app-tag-list {
    font-size: 0.7rem;
    padding: 2px 6px;
  }
  .view-toggle-group {
    order: -1;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .app-card-inner {
    padding: 15px;
  }
  .app-icon-container,
  .app-icon,
  .app-icon-placeholder {
    width: 60px;
    height: 60px;
  }
  .app-name {
    font-size: 1.1rem;
  }
  .search-container {
    margin-bottom: 1.5rem;
  }
  .cute-btn {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-md);
  }
  .action-buttons {
    gap: 8px;
  }
  .app-list-item-inner {
    flex-wrap: wrap;
    padding: 12px;
  }
  .drag-handle-list {
    width: 24px;
    font-size: var(--font-size-md);
  }
  .app-icon-container-list,
  .app-icon-list,
  .app-icon-placeholder-list {
    width: 45px;
    height: 45px;
  }
  .app-info-list {
    flex: 1 1 calc(100% - 200px);
  }
  .app-actions-list {
    margin-left: auto;
  }
  .app-actions-list .btn {
    width: 36px;
    height: 36px;
    font-size: var(--font-size-sm);
  }
  .app-command-list,
  .app-working-dir-list {
    font-size: var(--font-size-xs);
  }
  .view-toggle-btn {
    width: 38px;
    height: 38px;
  }
}

/* 列表项样式 */
.app-list-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: var(--transition-default);
  box-shadow: var(--box-shadow-sm);
  animation: fadeIn 0.5s ease;

  &:hover {
    transform: translateX(5px);
    box-shadow: var(--box-shadow-lg);
    border-color: rgba(255, 255, 255, 0.3);
  }
}

.app-list-item-inner {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  gap: 16px;
  position: relative;
}

.drag-handle-list {
  color: rgba(255, 255, 255, 0.4);
  cursor: move;
  font-size: var(--font-size-lg);
  padding: 5px;
  border-radius: 5px;
  transition: var(--transition-default);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  flex-shrink: 0;

  &:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
  }
}

.app-icon-container-list {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.app-icon-list {
  width: 60px;
  height: 60px;
  border-radius: var(--border-radius-md);
  object-fit: cover;
  box-shadow: var(--box-shadow-md);
}

.app-icon-placeholder-list {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #ff6b6b, #ffa500);
  border-radius: var(--border-radius-md);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: var(--box-shadow-md);
}

.app-info-list {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.app-name-list {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: #fff;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.app-command-list {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-family: 'Courier New', monospace;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: var(--transition-default);
  cursor: pointer;
  display: flex;
  align-items: center;

  &:hover {
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.9);
    transform: translateX(3px);
  }

  &.copy-success {
    animation: copySuccess 0.4s ease;
  }
}

.app-working-dir-list {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.app-tag-list {
  background: rgba(255, 255, 255, 0.4);
  color: #333;
  padding: 3px 8px;
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-xs);
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.app-actions-list {
  display: flex;
  gap: 8px;
  flex-shrink: 0;

  .btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    color: #fff;
    font-size: var(--font-size-md);
    transition: var(--transition-default);
    backdrop-filter: blur(5px);
  }
}

.btn-edit-list {
  background: rgba(0, 123, 255, 0.3);
  border: 1px solid rgba(0, 123, 255, 0.5);
  &:hover {
    background: rgba(0, 123, 255, 0.5);
    transform: scale(1.1);
  }
}

.btn-delete-list {
  background: rgba(220, 53, 69, 0.3);
  border: 1px solid rgba(220, 53, 69, 0.5);
  &:hover {
    background: rgba(220, 53, 69, 0.5);
    transform: scale(1.1);
  }
}

.search-indicator-list {
  position: absolute;
  top: 10px;
  right: 10px;
  color: rgba(255, 255, 255, 0.4);
  font-size: var(--font-size-sm);
  padding: 4px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
}

/* 列表拖拽状态 */
.app-list-item-dragging {
  opacity: 0.8;
}
.app-list-item-ghost {
  opacity: 0.3;
  background: rgba(255, 255, 255, 0.05) !important;
}
.app-list-item-chosen {
  transform: scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3) !important;
  z-index: 1000;
}
.app-list-item-drag {
  transform: rotate(2deg) scale(1.03);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4) !important;
}

/* 旧样式兼容 */
.precmd-head {
  width: 200px;
}
.monospace {
  font-family: 'Courier New', monospace;
}

.cover-finder .cover-results {
  max-height: 400px;
  overflow-x: hidden;
  overflow-y: auto;
  &.busy * {
    cursor: wait !important;
    pointer-events: none;
  }
}

.cover-container {
  padding-top: 133.33%;
  position: relative;
  &.result {
    cursor: pointer;
  }

  img {
    display: block;
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.spinner-border {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  margin: auto;
}

.config-page {
  padding: 1em;
  border: 1px solid #dee2e6;
  border-top: none;
}
tbody {
  border: none;
}
td {
  padding: 0 0.5em;
}
.env-table td {
  padding: 0.25em;
  border-bottom: rgba(0, 0, 0, 0.25) 1px solid;
  vertical-align: top;
}
.table .item-app {
  cursor: move;
  &:hover {
    background-color: #d38d9d91;
  }
}

/* 模态框和表单 */
.modal-xl {
  max-width: 1200px;
}
.form-section {
  margin-bottom: var(--spacing-xl);
}

.section-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  color: #495057;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: var(--spacing-xs);
}

.form-group-enhanced {
  margin-bottom: var(--spacing-lg);
}
.form-label-enhanced {
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: #7b8188;
}

.form-control-enhanced {
  border-radius: var(--border-radius-sm);
  border: 1px solid #ced4da;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  &:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  }
}

.required-field::after {
  content: ' *';
  color: var(--danger-color);
}
.field-hint {
  margin-top: var(--spacing-xs);
  font-size: var(--font-size-sm);
  color: var(--secondary-color);
}
.form-check-label {
  font-size: var(--font-size-md);
  color: var(--secondary-color);
}

.command-table {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-xl);
  padding: var(--spacing-xs);
  margin-top: var(--spacing-md);
  backdrop-filter: blur(20px);
  box-shadow: var(--box-shadow-lg);
  animation: fadeIn 0.6s ease-out;
}

.add-command-btn {
  margin-top: var(--spacing-md);
  background: var(--gradient-success);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: var(--border-radius-md);
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  backdrop-filter: blur(5px);
  transition: var(--transition-default);

  &:hover {
    background: var(--gradient-success-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    color: #fff;
  }
}

.modal-footer-enhanced {
  border-top: 1px solid #dee2e6;
  padding: var(--spacing-md) var(--spacing-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.save-status {
  font-size: var(--font-size-sm);
  color: var(--secondary-color);
}

.accordion-button {
  &:not(.collapsed) {
    color: #0c63e4;
    background-color: #e7f1ff;
    border-bottom-color: #86b7fe;
  }
  &:focus {
    z-index: 3;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  }
}

.is-invalid {
  border-color: #dc3545;
}
.is-valid {
  border-color: #198754;
}
.invalid-feedback {
  display: block;
  font-size: 0.875rem;
  color: #dc3545;
  margin-top: 0.25rem;
}
.valid-feedback {
  display: block;
  font-size: 0.875rem;
  color: #198754;
  margin-top: 0.25rem;
}

/* Steam封面查找 */
.cover-source-selector {
  margin-bottom: 1rem;
}
.cover-source-tabs {
  display: flex;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 1rem;
}

.cover-source-tab {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: #6c757d;
  transition: all 0.15s ease-in-out;

  &.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
  }
  &:hover {
    color: #0d6efd;
  }
}

.steam-app-info {
  font-size: 0.875rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* 扫描结果模态框 */
.scan-result-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg, rgba(0, 0, 0, 0.7));
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--spacing-lg, 20px);
  padding-top: 50px;
  overflow-y: auto;
}

.scan-result-modal {
  background: var(--modal-bg, rgba(30, 30, 50, 0.95));
  border: 1px solid var(--border-color-light, rgba(255, 255, 255, 0.2));
  border-radius: var(--border-radius-xl);
  width: 100%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-xl, 0 25px 50px rgba(0, 0, 0, 0.5));
  animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.scan-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md, 20px) var(--spacing-lg, 24px);
  border-bottom: 1px solid var(--border-color-light, rgba(255, 255, 255, 0.1));

  h5 {
    margin: 0;
    color: var(--text-primary, #fff);
    font-size: var(--font-size-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm, 8px);
  }
}

.scan-result-search {
  padding: var(--spacing-sm, 12px) var(--spacing-md, 20px);
  border-bottom: 1px solid var(--border-color-light, rgba(255, 255, 255, 0.08));
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.08) 100%);

  .search-box {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: auto;
  }

  .search-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius-lg, 12px);
    padding: 12px 44px 12px 44px;
    font-size: var(--font-size-sm, 14px);
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--text-primary, #fff);
    backdrop-filter: blur(8px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);

    &:hover {
      background: rgba(255, 255, 255, 0.08);
      border-color: rgba(255, 255, 255, 0.18);
    }

    &:focus {
      outline: none;
      background: rgba(255, 255, 255, 0.1);
      border-color: var(--color-primary, #667eea);
      box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(102, 126, 234, 0.15);
    }

    &::placeholder {
      color: rgba(255, 255, 255, 0.4);
      font-weight: 400;
    }
  }

  .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.45);
    font-size: var(--font-size-sm, 14px);
    pointer-events: none;
    transition: color 0.2s ease;
  }

  .search-input:focus ~ .search-icon,
  .search-box:focus-within .search-icon {
    color: var(--color-primary, #667eea);
  }

  .btn-clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    border-radius: var(--border-radius-sm, 6px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;

    &:hover {
      color: #fff;
      background: rgba(255, 255, 255, 0.15);
      transform: translateY(-50%) scale(1.05);
    }

    &:active {
      transform: translateY(-50%) scale(0.95);
    }
  }
}

.scan-result-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-sm, 12px) var(--spacing-md, 20px);
}

.scan-result-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm, 8px);
}

.scan-result-item {
  display: flex;
  align-items: stretch;
  gap: var(--spacing-md, 16px);
  padding: 0;
  background: var(--card-bg-hover, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border-color-light, rgba(255, 255, 255, 0.1));
  border-radius: var(--border-radius-md);
  transition: var(--transition-default);
  overflow: hidden;

  &:hover {
    background: var(--card-bg-active, rgba(255, 255, 255, 0.1));
    border-color: var(--border-color-hover, rgba(255, 255, 255, 0.2));
    transform: translateX(4px);
  }
}

.scan-app-icon {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.2));
  min-width: 56px;

  img {
    height: 80px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }
}

.scan-app-info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs, 2px);
  flex: 1;
  min-width: 0;
  padding: var(--spacing-xs, 2px) 0;
}

.scan-app-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scan-app-cmd {
  font-size: var(--font-size-xs, 12px);
  color: var(--text-primary, rgba(255, 255, 255, 0.85));
  font-family: var(--font-mono, 'Courier New', monospace);
  background: var(--code-bg, rgba(0, 0, 0, 0.3));
  border-radius: var(--border-radius-xs, 4px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: var(--spacing-xs, 4px) var(--spacing-xs, 2px);
  display: inline-block;
  max-width: 100%;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.scan-app-path {
  font-size: var(--font-size-xs, 12px);
  color: var(--text-secondary, rgba(255, 255, 255, 0.65));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.scan-app-actions {
  display: flex;
  gap: var(--spacing-xs, 6px);
  flex-shrink: 0;
  padding: var(--spacing-sm, 8px) var(--spacing-sm, 12px);
  align-items: center;

  .btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-default);
    &:hover {
      transform: scale(1.1);
    }
  }
}

.scan-result-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md, 12px);
  padding: var(--spacing-sm, 12px) var(--spacing-md, 20px);
  border-top: 1px solid var(--border-color-light, rgba(255, 255, 255, 0.1));

  .btn {
    padding: var(--spacing-sm, 10px) var(--spacing-lg, 20px);
    border-radius: var(--border-radius-md);
    font-weight: 500;
    transition: var(--transition-default);
  }

  .btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: var(--text-primary, #fff);
    &:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-primary, 0 8px 25px rgba(102, 126, 234, 0.4));
    }
  }

  .btn-secondary {
    background: var(--btn-secondary-bg, rgba(255, 255, 255, 0.1));
    border: 1px solid var(--border-color-light, rgba(255, 255, 255, 0.2));
    color: var(--text-primary, #fff);
    &:hover {
      background: var(--btn-secondary-bg-hover, rgba(255, 255, 255, 0.15));
    }
  }
}

.scan-result-empty {
  text-align: center;
  padding: var(--spacing-xxl, 40px) var(--spacing-lg, 20px);
  color: var(--text-muted, rgba(255, 255, 255, 0.5));

  i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md, 16px);
    opacity: 0.5;
  }
  p {
    margin: 0;
    font-size: var(--font-size-md);
  }
}
